#delimit;
use "20161021_State_Parameters_w_Var.dta", clear;


drop if FIPS==.;
gen baseline=(A+B1);
gen falloff=(B1 - B1*exp(B2));

gen SE_baseline=V_A+V_B1+2*C_AB1;
replace SE_baseline=(sqrt(SE_baseline));

gen HI_baseline=baseline+1.96*SE_baseline;
gen LO_baseline=baseline-1.96*SE_baseline;

gen dfB1=(1- exp(B2));
gen dfdB2=-B1*exp(B2);


gen SE_falloff= V_B1 * dfB1^2  + V_B2* dfdB2^2   + 2*dfB1*dfdB2*C_B1B2 ;
replace SE_falloff=sqrt(SE_falloff);
gen HI_falloff=falloff+1.96*SE_falloff;
gen LO_falloff=falloff-1.96*SE_falloff;

set scheme s1mono;

twoway rspike HI_baseline LO_baseline falloff, lc(gs10) lwidth(vthin)
	|| scatter baseline falloff, mlab(state_alpha)  m(0) mc(white) mlabp(0) mlabc("gs8") msize(med) mlabsize(small)
 	|| rspike HI_baseline LO_baseline falloff if FIPS==6 | FIPS==48, lc(gs10) lwidth(vthin)
 	|| scatter baseline falloff if FIPS==6  | FIPS==12 | FIPS==48, ml(state_alpha) mlabc(gs2)   m(0) mc(white) mlabsize(small)
	  	m(i) mlabp(0)  msize(large)
		xline( .1115091, lc("gs10") lwidth(vthin)) 
		yline( 5.509253 , lc("gs10") lwidth(vthin)) 
		ylabel(3 "$3,000" 4 "$4,000" 5 "$5,000" 6 "$6,000" 7 "$7,000" 8 "$8,000", 
		labsize(vsmall)  format(%12.0fc))
		xlabel(.050 "$50" .075 "$75" .1 "$100" .125 "$125" .150 "$150" .175 "$175" .2 "$200" 
		.225 "$225", labsize(vsmall) format(%12.0fc)) 
		legend(off) graphregion(color(white))   
		xtitle("Relief Falloff [B1*(1-exp(B2)]", size(small))   ytitle("Baseline Support [A+B1]", size(small))
		;

  
graph save 20161021_Parameters.gph, replace;

graph export 20161021_Parameter.pdf, replace fontface("Helvetica");


